// Source File Name:   AccessFlag.java

package com.vhly.classfile;


public class AccessFlag {

    public static final int ACC_PUBLIC = 1;
    public static final int ACC_PRIVATE = 2;
    public static final int ACC_PROTECTED = 4;
    public static final int ACC_STATIC = 8;
    public static final int ACC_FINAL = 16;
    public static final int ACC_SYNCHRONIZED = 32;
    public static final int ACC_VOLATILE = 64;
    public static final int ACC_ = 128;
    public static final int ACC_NATIVE = 256;
    public static final int ACC_INTERFACE = 512;
    public static final int ACC_ABSTRACT = 1024;

    public AccessFlag() {
    }

    public static String toString(int i) {
        String s = " ";
        if ((i & 1) == 1)
            s = (new StringBuilder()).append(s).append("public ").toString();
        else if ((i & 2) == 2)
            s = (new StringBuilder()).append(s).append("private ").toString();
        else if ((i & 4) == 4)
            s = (new StringBuilder()).append(s).append("protected ").toString();
        if ((i & 8) == 8)
            s = (new StringBuilder()).append(s).append(" static ").toString();
        if ((i & 0x10) == 16)
            s = (new StringBuilder()).append(s).append(" final ").toString();
        if ((i & 0x20) == 32)
            s = (new StringBuilder()).append(s).append(" synchronized ").toString();
        if ((i & 0x40) == 64)
            s = (new StringBuilder()).append(s).append(" volatile ").toString();
        if ((i & 0x80) == 128)
            s = (new StringBuilder()).append(s).append(" transient ").toString();
        if ((i & 0x100) == 256)
            s = (new StringBuilder()).append(s).append(" native ").toString();
        if ((i & 0x200) == 512)
            s = (new StringBuilder()).append(s).append(" interfac ").toString();
        if ((i & 0x400) == 1024)
            s = (new StringBuilder()).append(s).append(" abstract ").toString();
        return s;
    }
}